<!DOCTYPE html>
<!-- saved from url=(0042)https://sc.myuserhub.com/portal/pswdchange -->
<html>
{include file="public/head"}
<body>
{include file="public/nav"}

<!--<div class="container">-->
<div class="rowHeader">
    <div class="container">
        <div class="row">
            <div class="col-lg-6 col-md-6" style="text-align:left">
                <h1>

                    欢迎 <span class="userName">{$UserInfo.username}</span>

                    <span class="label label-success lb-sm" style="vertical-align: middle;">通过审核</span>


                </h1>
            </div>
            <!--End collumn-->

            <div class="col-lg-6 col-md-6 pageTitleRight">
                <h1 class="pull-right">修改密码</h1>
            </div>
            <!--End collumn-->

        </div>
        <!--End Row-->
    </div>
    <!--End container-->
</div>
<!--End Row-->

<div class="container">
    <div class="row mainRow">

        <!--菜单栏-->
        {include file="public/menu"}
        <!--End column-->
        <div class="col-lg-9 col-md-12 col-sm-12 mainContent">



            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        修改密码 </h4>
                </div>
                <div class="panel-body">

                    <form method="post">
                        <div class="form-group" id="groupOldPassword">
                            <label class="col-lg-4 col-md-4 control-label" for="old_password">原密码 <span
                                    class="redStar">*</span></label>
                            <div class="col-lg-8 col-md-8">
                                <input type="password" id="old_password" name="old_password" class="form-control"
                                       placeholder="">
                                <span class="help-block helpBlockOldPassword"></span>
                            </div>
                            <!--End column-->
                        </div>
                        <!--Input Old Pass -->
                        <div class="form-group" id="groupNewPassword">
                            <label class="col-lg-4 col-md-4 control-label" for="new_password">新密码 <span
                                    class="redStar">*</span></label>
                            <div class="col-lg-8 col-md-8">
                                <input type="password" id="new_password" name="new_password" class="form-control"
                                       placeholder="">
                                <span class="help-block helpBlockOldPassword"></span>
                            </div>
                            <!--End column-->
                        </div>
                        <!--End Old Pass-->
                        <div class="form-group" id="groupNewPasswordRe">
                            <label class="col-lg-4 col-md-4 control-label" for="new_password_re">确认新密码 <span
                                    class="redStar">*</span></label>
                            <div class="col-lg-8 col-md-8">
                                <input type="password" id="new_password_re" name="new_password_re" class="form-control"
                                       placeholder="">
                                <span class="help-block helpBlockOldPassword"></span>
                            </div>
                            <!--End column-->
                        </div>
                        <button type="submit" id="deposit" class="btn btn-primary greenBtn pull-right" style="margin-right: 15px;">提交 </button>

                    </form>

                </div>
                <!--End panel body-->
            </div>
            <!--End panel-->


        </div>
        <!--End column-->

    </div>
    <!--End row-->
</div>
<!--End container-->

{include file="public/foot"}
</body>
<script src="/static/Admin/layer/layer.js"></script>
<script>
    var flag = 1;
    $("#deposit").click(function (e) {
        e.preventDefault();
        if (!flag){
            return  false
        }
        var old_password = $("#old_password").val()
        var new_password = $("#new_password").val()
        var new_password_re = $("#new_password_re").val()
        if (old_password == ''){
            layer.msg('请输入旧密码');
            return false
        }
        if (new_password == ''){
            layer.msg('请输入新密码');
            return false
        }
        if (new_password_re != new_password){
            layer.msg('两次密码不一致');
            return false
        }
        var that = $(this)
        that.attr('disabled',true)
        flag = 0;
        $.ajax({
            type:"post",
            dataType:"json",
            data:{old_password:old_password,new_password:new_password},
            url:"{:url('User/UserPassLogin')}",
            success:function (data) {
                if (data.status == 1){
                    layer.msg(data.message,{time:1500},function () {
                        window.location.reload()
                    })
                }else {
                    layer.msg(data.message,{time:1500},function () {
                        that.removeAttr('disabled')
                        flag = 1;
                    })

                }
            }
        })
    })
</script>
</html>
